#include "Chess.h"

#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")

Chess::Chess(int gradeSize, int margin_x, int margin_y, float chessSize) {
    this->gradeSize = gradeSize;
    this->margin_x = margin_x;
    this->margin_y = margin_y;
    this->chessSize = chessSize;
    playerFlag = CHESS_BLACK;

    // 初始化棋盘的数据
    for (int i = 0; i < gradeSize; i++) {
        vector<int> row;
        for (int j = 0; j < gradeSize; j++) {
            row.push_back(0);
        }
        chessMap.push_back(row);
    }
}

void Chess::init() {
    // 加载棋子的图片资源
    initgraph(897, 895);
    loadimage(NULL, _T("res/棋盘2.jpg"));
    mciSendString("play res/start.wav", 0, 0, 0);

    loadimage(&chessBlackImg, _T("res/black.png"), chessSize, chessSize, true);
    loadimage(&chessWhiteImg, _T("res/white.png"), chessSize, chessSize, true);
}

bool Chess::clickBoard(int x, int y, ChessPos* pos) { return false; }

void Chess::chessDown(ChessPos* pos, chess_kind_t kind) {}

int Chess::getGradeSize() { return 0; }

int Chess::getChessData(ChessPos* pos) { return 0; }

int Chess::getChessData(int row, int col) { return 0; }

bool Chess::checkOver() { return false; }
